# -*- python -*-
# ex: set syntax=python:

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# See master.experimental/slaves.cfg for documentation.

slaves = [
  # MAC
  {
    'master': 'Dart',
    'builder': ['vm-mac-debug-ia32'],
    'hostname': 'vm620-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-debug-x64'],
    'hostname': 'vm654-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-release-ia32'],
    'hostname': 'vm681-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-release-x64'],
    'hostname': 'vm666-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-mac-x64-be', 'dartium-mac-x64-dev'],
    'hostname': 'vm619-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64'
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-mac10.11-chrome'],
    'hostname': 'vm642-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64'
  },

  # LINUX
  {
    'master': 'Dart',
    'builder': ['vm-kernel-linux-debug-x64'],
    'hostname': 'slave146-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-kernel-linux-release-x64'],
    'hostname': 'slave148-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-ia32'],
    'hostname': 'vm9-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-x64'],
    'hostname': 'vm157-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-ia32-asan'],
    'hostname': 'vm36-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-x64-asan'],
    'hostname': 'vm10-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-ia32'],
    'hostname': 'vm11-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-x64'],
    'hostname': 'vm158-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-simmips'],
    'hostname': 'vm19-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-simmips'],
    'hostname': 'vm72-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-simarm'],
    'hostname': 'vm343-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-simarm'],
    'hostname': 'vm26-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-simarm64'],
    'hostname': 'vm160-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-android-release-1-3'],
    'hostname': 'build10-b3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-android-release-2-3'],
    'hostname': 'build11-b3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-android-release-3-3'],
    'hostname': 'build12-b3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-debug-ia32'],
    'hostname': 'vm146-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '32',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-release-ia32'],
    'hostname': 'vm147-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '32',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-release-x64'],
    'hostname': 'vm204-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-debug-x64'],
    'hostname': 'vm139-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-product-x64'],
    'hostname': 'slave134-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-product-x64'],
    'hostname': 'vm233-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-product-x64'],
    'hostname': 'vm8-m3',
    'os': 'mac',
    'version': '10.11',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['app-linux-debug-x64'],
    'hostname': 'slave135-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['app-linux-release-x64'],
    'hostname': 'slave136-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['app-linux-product-x64'],
    'hostname': 'slave137-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['precomp-linux-debug-x64'],
    'hostname': 'slave138-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['precomp-linux-product-x64'],
    'hostname': 'slave139-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-x64-reload'],
    'hostname': 'slave140-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-x64-reload-rollback'],
    'hostname': 'slave144-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-debug-x64-reload-rollback'],
    'hostname': 'slave145-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-x64-reload'],
    'hostname': 'slave141-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['target-arm-vm-linux-release'],
    'hostname': 'build31-b3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '32',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-ia32-optcounter-threshold'],
    'hostname': 'vm104-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-linux-release-x64-optcounter-threshold'],
    'hostname': 'vm207-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-debug-simdbc64'],
    'hostname': 'vm676-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-release-simdbc64'],
    'hostname': 'vm679-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-noopt-simarm64-mac'],
    'hostname': 'vm680-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['cross-arm-vm-linux-release'],
    'hostname': 'slave143-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart-sdk-windows'],
    'hostname': 'vm128-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart-sdk-mac'],
    'hostname': 'vm683-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart-sdk-linux'],
    'hostname': 'slave142-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-minified-1-5'],
    'hostname': 'slave102-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-minified-2-5'],
    'hostname': 'slave116-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-minified-3-5'],
    'hostname': 'slave41-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-minified-4-5'],
    'hostname': 'slave42-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-minified-5-5'],
    'hostname': 'slave118-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-hostchecked-unittest-1-5'],
    'hostname': 'slave119-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-hostchecked-unittest-2-5'],
    'hostname': 'slave120-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-hostchecked-unittest-3-5'],
    'hostname': 'slave104-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-hostchecked-unittest-4-5'],
    'hostname': 'slave105-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-d8-hostchecked-unittest-5-5'],
    'hostname': 'slave121-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-linux-x64'],
    'hostname': 'slave133-c3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-drt-1-2'],
    'hostname': 'slave114-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-drt-2-2'],
    'hostname': 'slave94-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-drt-csp-minified'],
    'hostname': 'slave115-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-chromeff-1-4'],
    'hostname': 'slave106-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-chromeff-2-4'],
    'hostname': 'slave96-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-chromeff-3-4'],
    'hostname': 'slave97-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-chromeff-4-4'],
    'hostname': 'slave95-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-chrome-1-4'],
    'hostname': 'vm56-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-chrome-2-4'],
    'hostname': 'vm195-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-chrome-3-4'],
    'hostname': 'vm214-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-chrome-4-4'],
    'hostname': 'vm211-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-ie11ff-1-4'],
    'hostname': 'vm126-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-ie11ff-2-4'],
    'hostname': 'vm234-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-ie11ff-3-4'],
    'hostname': 'vm148-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win7-ie11ff-4-4'],
    'hostname': 'vm212-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win8-ie11-1-4'],
    'hostname': 'vm236-m3',
    'os': 'win',
    'version': 'win8',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win8-ie11-2-4'],
    'hostname': 'vm237-m3',
    'os': 'win',
    'version': 'win8',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win8-ie11-3-4'],
    'hostname': 'vm166-m3',
    'os': 'win',
    'version': 'win8',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-win8-ie11-4-4'],
    'hostname': 'vm164-m3',
    'os': 'win',
    'version': 'win8',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['analyze-linux'],
    'hostname': 'slave125-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['analyzer-win7-release'],
    'hostname': 'vm18-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['analyzer-win7-release-strong'],
    'hostname': 'vm213-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['analyzer-mac10.11-release',
                'analyzer-mac10.11-release-strong'],
    'hostname': 'vm663-m3',
    'os': 'mac',
    'version': '10.9.5',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['analyzer-linux-release', 'analyzer-linux-release-strong'],
    'hostname': 'vm41-m3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },

  {
    'master': 'Dart',
    'builder': ['dart2js-mac10.11-safari-1-3'],
    'hostname': 'vm644-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-mac10.11-safari-2-3'],
    'hostname': 'vm656-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-mac10.11-safari-3-3'],
    'hostname': 'vm668-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-jsshell-1-4'],
    'hostname': 'slave39-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-jsshell-2-4'],
    'hostname': 'slave40-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-jsshell-3-4'],
    'hostname': 'slave88-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dart2js-linux-jsshell-4-4'],
    'hostname': 'slave89-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },

  # Windows
  {
    'master': 'Dart',
    'builder': ['vm-precomp-win-simarm64-1-4'],
    'hostname': 'vm161-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-win-simarm64-2-4'],
    'hostname': 'vm208-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-win-simarm64-3-4'],
    'hostname': 'vm251-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-precomp-win-simarm64-4-4'],
    'hostname': 'vm252-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-win-ia32-be',
                'dartium-win-ia32-stable'],
    'hostname': 'vm215-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-win-debug-ia32-russian'],
    'hostname': 'vm209-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-linux-x64-inc-be',
                'dartium-linux-x64-inc-integration'],
    'hostname': 'slave126-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-win-ia32-integration'],
    'hostname': 'vm339-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-win-ia32-inc-integration'],
    'hostname': 'vm77-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-win-ia32-dev',
                'dartium-win-ia32-inc-be'],
    'hostname': 'vm112-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-mac-x64-inc-be',
                'dartium-mac-x64-inc-integration'],
    'hostname': 'vm604-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['pkg-win7-release'],
    'hostname': 'vm249-m3',
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['vm-mac-release-simdbc64-reload',
                'vm-mac-debug-simdbc64-reload'],
    'hostname': 'vm655-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['pkg-mac10.11-release'],
    'hostname': 'vm650-m3',
    'os': 'mac',
    'version': '10.9.5',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['pkg-linux-release'],
    'hostname': 'slave84-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  {
    'master': 'Dart',
    'builder': ['dartium-mac-x64-integration',
                'dartium-mac-x64-stable'],
    'hostname': 'vm630-m3',
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64'
  },
  {
    'master': 'Dart',
    'builder': ['versionchecker-linux'],
    'hostname': 'slave122-c3',
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  },
  # This slave has a debian jessie chroot that it runs in.
  # Do not modify or reimage it. Contact whesse@google for questions.
  {
    'master': 'Dart',
    'builder': ['debianpackage-linux'],
    'hostname': 'vm153-m3',
    'os': 'linux',
    'version': 'precise',
    'bits': '64',
  },
] + [
  # http://crbug.com/151174
  {
    'master': 'DartUnused',
    'hostname': 'vm%d-m3' % i,
    'os': 'win',
    'version': 'win7',
    'bits': '64',
  } for i in [250]
] + [
  {
    'master': 'DartUnused',
    'hostname': 'vm%d-m3' % i,
    'os': 'win',
    'version': 'win8',
    'bits': '64',
  } for i in []
] + [
  {
    'master': 'DartUnused',
    'hostname': 'vm%d-m3' % i,
    'os': 'win',
    'version': 'win10',
    'bits': '64',
  } for i in [21, 35, 45, 50, 52]
] + [
  {
    'master': 'DartUnused',
    'hostname': 'vm%d-m3' % i,
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  } for i in []
] + [
  {
    'master': 'DartUnused',
    'hostname': 'slave%d-c3' % i,
    'os': 'linux',
    'version': 'trusty',
    'bits': '64',
  } for i in [99, 124, 127, 128, 237, 238, 239, 240]
] + [
  {
    'master': 'DartUnused',
    'hostname': 'vm%s-m3' % i,
    'os': 'mac',
    'version': '10.11.4',
    'bits': '64'
  } for i in [55, 60, 66, 67, 73]
]


# This is a hack to eliminate the need for sharing code between master and
# clients. These channels are replicated in scripts/factory/dart/channels.py.
channel_postfixes = ['-be', '-dev', '-stable', '-integration']

def valid_for_channel(builder, channel):
  """ Returns true if we have this builder on this specific channel"""
  return channel != '-integration' or 'dartium' in builder

def is_channel_builder(builder):
  """Returns true if the builder name is already specific to a channel
  (i.e. the builder ends with a channel postfix)."""
  for postfix in channel_postfixes:
    if builder.endswith(postfix):
      return True
  return False

def duplicate_builders_in_slaves(slaves):
  """Traverses a list of slaves and duplicates the builders associated with each
  slave for every channel. The channels have specified the postfix."""
  for slave in slaves:
    all_builders = []
    for builder in slave.get('builder', ()):
      if ('v8' not in builder
          and not is_channel_builder(builder)):
        for channel in channel_postfixes:
          # Some channels don't have all builders
          if valid_for_channel(builder, channel):
            all_builders.append('%s%s' % (builder, channel))
      else:
        all_builders.append(builder)
    slave['builder'] = all_builders
  return slaves


class InvalidDartBuilder(Exception):
  def __init__(self):
    Exception.__init__(self, ('Error: Cannot use ccompute for '
        'master.client.dart slaves due to ipv6 requirements.'))


def check_for_ccompute(slaves):
  """Ccompute cannot be used for dart as ipv6 is needed."""
  for slave in slaves:
    if 'builder' in slave:
      for builder in slave['builder']:
        if (builder.startswith('vm-') and
            'product' not in builder and
            'reload' not in builder and
            'kernel' not in builder and
            'slave' in slave['hostname'] and
            slave['os'] == 'linux'):
          raise InvalidDartBuilder()

check_for_ccompute(slaves)
slaves = duplicate_builders_in_slaves(slaves)
